
class ProductEntity {
  int itemNumId;
  String itemName;
  int ecShopNumId;
  double price;
  double marketPrice;
  double commissionRatio;
  double commissionAmount;
  String imageSrc;
  int ecStyleNumId;
  int styleNumId;
  String listImage;
  double store;
  int favoriteSign;
  int distributionCommissionSign;
  double soldQuantity;
  double expectPrice;
  int isSeckill;
  int isPreSale;

  ProductEntity(
      {this.itemNumId,
        this.itemName,
        this.ecShopNumId,
        this.price,
        this.marketPrice,
        this.commissionRatio,
        this.commissionAmount,
        this.imageSrc,
        this.ecStyleNumId,
        this.styleNumId,
        this.listImage,
        this.store,
        this.favoriteSign,
        this.distributionCommissionSign,
        this.soldQuantity,
        this.expectPrice,
        this.isSeckill,
        this.isPreSale});

  ProductEntity.fromJson(Map<String, dynamic> json) {
    itemNumId = json['item_num_id'];
    itemName = json['item_name'];
    ecShopNumId = json['ec_shop_num_id'];
    price = json['price'];
    marketPrice = json['market_price'];
    commissionRatio = json['commission_ratio'];
    commissionAmount = json['commission_amount'];
    imageSrc = json['image_src'];
    ecStyleNumId = json['ec_style_num_id'];
    styleNumId = json['style_num_id'];
    listImage = json['list_image'];
    store = json['store'];
    favoriteSign = json['favorite_sign'];
    distributionCommissionSign = json['distribution_commission_sign'];
    soldQuantity = json['sold_quantity'] ?? 0;
    expectPrice = json['expect_price'];
    isSeckill = json['is_seckill'];
    isPreSale = json['is_pre_sale'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['item_num_id'] = this.itemNumId;
    data['item_name'] = this.itemName;
    data['ec_shop_num_id'] = this.ecShopNumId;
    data['price'] = this.price;
    data['market_price'] = this.marketPrice;
    data['commission_ratio'] = this.commissionRatio;
    data['commission_amount'] = this.commissionAmount;
    data['image_src'] = this.imageSrc;
    data['ec_style_num_id'] = this.ecStyleNumId;
    data['style_num_id'] = this.styleNumId;
    data['list_image'] = this.listImage;
    data['store'] = this.store;
    data['favorite_sign'] = this.favoriteSign;
    data['distribution_commission_sign'] = this.distributionCommissionSign;
    data['sold_quantity'] = this.soldQuantity;
    data['expect_price'] = this.expectPrice;
    data['is_seckill'] = this.isSeckill;
    data['is_pre_sale'] = this.isPreSale;
    return data;
  }
}
